package com.ajx.core.ui;

import android.app.Dialog;
import android.content.Context;
import android.support.v7.app.AppCompatDialog;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lai on 2017/12/4.
 */

public class DialogUtil {
    private static List<Dialog> loadings =new ArrayList();

    public static void showLoading(Context context,View view){
        AppCompatDialog appCompatDialog =new AppCompatDialog(context);
        appCompatDialog.setContentView(view);
        appCompatDialog.show();
        loadings.add(appCompatDialog);
    }
    public static void dismiss(){
        for (Dialog dialog:loadings){
            if (dialog!=null){
                dialog.cancel();
            }
        }
    }

}
